home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / emerald / emrldsys.lha / Kernel / h / map96.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-17  |  1.3 KB  |  58 lines

  1. #ifndef map96_h
  2. #define map96_h
  3.  
  4. /*
  5.  * Map96s are things that map96 one integer onto another.  There are
  6.  * create, insert, lookup, and destroy operations.
  7.  */
  8.  
  9. typedef struct TE96 {
  10.     int key0, key1, key2;    /* the key for this entry */
  11.     int value;            /* what we want */
  12. } TE96, *TE96Ptr;
  13.  
  14. typedef struct Map96Record {
  15.     TE96Ptr table;
  16.     int maxIndex, maxCount, count;
  17. } Map96Record, *Map96;
  18.  
  19. #define NIL ((unsigned)0x80000000)
  20.  
  21. Map96 Map96_Create();
  22.  
  23. Map96 Map96_CreateSized(/* count */);
  24. /* int count */
  25.  
  26. void Map96_Clear(/* map96 */);
  27. /* Map96 map96; */
  28.  
  29. void Map96_Insert(/* map96, key0, key1, key2, value */);
  30. /* Map96 map96; int key0, key1, key2, value; */
  31.  
  32. int Map96_Lookup(/* map96, key0, key1, key2 */);
  33. /* Map96 map96; int key0, key1, key2; */
  34.  
  35. int Map96_InverseLookup(/* map96, value */);
  36. /* Map96 map96; int value; */
  37.  
  38. void Map96_Delete(/* map96, key0, key1, key2 */);
  39. /* Map96 map96; int key0, key1, key2; */
  40.  
  41. void Map96_Destroy(/* map96 */);
  42. /* Map96 map96; */
  43.  
  44. void Map96_Print(/* map96 */);
  45. /* Map96 map96; */
  46.  
  47. #define Map96_For(m, key0, key1, key2, value) \
  48.   { \
  49.     int zzIndexzz = 0; \
  50.     while (Map96_FindNext((m), &zzIndexzz, (int *)&(key0), (int *)&(key1), (int *)&(key2), (int *)&value)) {
  51. #define Map96_Next \
  52.     } \
  53.   }
  54.  
  55. #define Map96_Count(m) ((m)->count)
  56.  
  57. #endif
  58.